<?php
/*
 * This file is part of the BooXtore Student project.
 *
 * (c) Francis Backeland f.backeland@gmail.com
 * (c) Laurine Chaplot chaplot.laurine@orange.fr
 * (c) Julien Dutot julien.dutot@gmail.com
 * (c) Romain Guillaume romain-guillaume@orange.fr
 * (c) Guillaume Paringaux g.paringaux@gmail.com
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code
 */
namespace BXTR\LayoutBundle\Form\Type;

use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use BXTR\LayoutBundle\Form\Type\IconButtonType;

/**
 * Add button, same as icon button, with configured icon and label
 *
 * @uses IconButtonType
 */
class AddButtonType extends IconButtonType
{
    /** 
     * Form clean name : add_button
     */
    public function getName()
    {
        return 'add_button';
    }

    /**
     * Extends the icon button FormType
     */
    public function getParent()
    {
        return 'icon_button';
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'icon' => 'plus-sign',
            'label' => 'Form.Add',
            'attr' => Array('class' => 'btn-success')
        ));
    }
}
